package dk.cs.wolverine.shared;

import java.io.Serializable;

import javax.jdo.annotations.IdGeneratorStrategy;
import javax.jdo.annotations.Persistent;
import javax.jdo.annotations.PrimaryKey;

/**
 * En klasse der er beregnet til at vedligeholde oplysninger om hvor mange der
 * har valgt denne svarmulighed i et SelectQuestion.
 * 
 * @author Kalle
 * 
 */
public class Answer implements Serializable {

	private static final long serialVersionUID = 1776400177556358416L;

	@PrimaryKey
	@Persistent(valueStrategy = IdGeneratorStrategy.IDENTITY)
	private Long key;

	@Persistent
	int point;

	@Persistent
	String answer;

	SelectQuestion question;

	public Answer(String answer, int point, SelectQuestion question) {
		this.answer = answer;
		this.point = point;
		this.question = question;
	}

	public Answer() {

	}

	public int getPoint() {
		return point;
	}

	public void setPoint(int point) {
		this.point = point;
	}

	public void incPoint() {
		this.point++;
	}

	public void decPoint() {
		this.point--;
	}

	public String getAnswer() {
		return answer;
	}

	public void setAnswer(String answer) {
		this.answer = answer;
	}

	public Long getKey() {
		return key;
	}

	public void setKey(Long key) {
		this.key = key;
	}

	public SelectQuestion getQuestion() {
		return question;
	}

	public void setQuestion(SelectQuestion question) {
		this.question = question;
	}
}